﻿using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NCT.INVPOS.DataAccessLayer.Entity;

namespace NCT.INVPOS.DataAccessLayer.Configurations
{
    public class CustomerConfiguration : EntityTypeConfiguration<Customer>
    {
        public CustomerConfiguration()
        {
            HasKey(P => P.Id);

            Property(P => P.FirstName).IsRequired().HasMaxLength(30);

            Property(P => P.LastName).IsRequired().HasMaxLength(30);

            Property(P => P.MiddleName).IsOptional().HasMaxLength(30);

            Property(P => P.BillingAddress).IsOptional().HasMaxLength(100);

            Property(P => P.ShippingAddress).IsOptional().HasMaxLength(100);

            Property(P => P.Gender).IsRequired();
        }
    }
}
